// TypeScript file

module py2Obj {

    export class strikeFixationBullet extends basicObj {
        //保存外部的物理世界

        public pointList: egret.Point[] = [];
        public label: egret.TextField = new egret.TextField();


        public constructor(world: any, gamePanle: any, romveSkins: any) {
            super(world, gamePanle, romveSkins);
            this.objkind = 108;
        }
        public init() {
            super.init();
        }

        public createMyRigidbody(): p2.Body {
            var world: P2World = this.m_world;
            var skin: MImage = this.createSkin("chu_png");
            var body: p2.Body = world.createCircleBodyShape(13, p2.Body.KINEMATIC);
            body.userData.skin = skin;
            body.userData.data = this;
            body.mass = 0;//质量设置为0，就可以按规定方向发射，等发生碰撞之后再给球质量
            //body.gravityScale=0;
            var shape = body.shapes[0];
            //	shape.collisionGroup = 2;//010与001为0，010与110为1
            shape.collisionMask = 6;
            this.label.text = "0";
            this.label.height = 100;
            this.label.width = 200;
            this.label.size = 28;
            this.label.textColor = 0xFF0000;
            
            // this.label.x = this.m_body.position[0];
            // this.label.y = this.m_body.position[1];

            //this.label.x = this.m_body.position[0];
            //this.label.y = this.m_body.position[1];
            // shape.collisionMask=2;
            // trace(shape.collisionGroup,shape.collisionMask)
            return body;
        }
        		// protected createText(x: number = 0, y: number = 0, s: string = ""): TextField {
		// 	var text: TextField = (new Label).textField;
		// 	text.x = x; text.y = y; text.text = s;
		// 	this.addChild(text);
		// 	return text;
		// }
        public getCollision(otherBody: basicObj) {
            super.getCollision(otherBody);
            // if (otherBody.objkind == 103) {	
            // 	this.removebullet(this);
            // }
        }
        public removeBasicbullet(ba: basicBullet) {
            this.m_world.removeBodys.push(ba.getBody());
            this.m_removeSkins.push(ba.getBody().userData.skin);
        }



    }
}